

/*===== 检查登录状态 =====*/
function checkLoginStutus(){
	var navBtn = $('.nav-btn');
	var loginBtn = $('.login-btn');
	if( login_stutus ){
		loginBtn.hide();
		var html = myApp.templates.panelTemplate(myApp.template7Data["page:index"]);
		$('.panel-left').html(html);
	}else{
		loginBtn.show();
	}
}
/*===== 通过cookie登录 =====*/
function cookieLogin(){
	var username = $.cookie('username');
	var password = $.cookie('password');
//	myApp.alert('username:'+username +',password:'+password);
	$.ajax({
		url:'jsondata/data.json',
		dataType:'json',
		async:false,
		data:{
			stu_no:username,
	    	stu_pass:password
		},
		success:function(data){
    		if(username == data.testData.stu_no && password == data.testData.stu_pass && data.login_stutus){
    			
    			login_stutus = true;
    			myApp.template7Data["page:index"] = data
    			checkLoginStutus();
    			
    		}
    	}
	})
}